package com.example.utils.initializationconfig;

import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

/**
 * TODO   Spring 4.2 之后引入了新的 @EventListener注解，可以实现和ApplicationListener同样的效果
 *
 * @ClassName EventListenerExampleBean
 * @Author xiaojiang
 * @Date 2021/9/28 下午 16:51
 */
@Component
public class EventListenerExampleBean {


    @EventListener
    public void onApplicationEvent(ContextRefreshedEvent event) {

        System.out.println("EventListener注解........");

    }




}
